<template>
  <nav>
    <div class="banxin tanxin nav_in">
      <img src="../assets/images/indexLogo.png" alt="" />
      <ul class="tanxin">
        <li @click="$router.push('/')" :class="{'active': $route.path === '/home' || $route.path === '/'}">首页</li>
        <li @click="$router.push('/goods')" :class="{'active': $route.path === '/goods' }">全部商品</li>
        <li @click="$router.push('/user')" :class="{'active': $route.path === '/user' }">个人中心</li>
        <li @click="$router.push('/order')" :class="{'active': $route.path === '/order' }">我的订单</li>
        <li @click="$router.push('/free')" :class="{'active': $route.path === '/free' }">专属福利</li>
      </ul>
      <div class="search tanxin">
        <input type="text" placeholder="搜索全部商品直接回车" />
        <div class="btn">
          <img src="../assets/images/search.png" alt="" />
        </div>
      </div>
    </div>
  </nav>
</template>

<script>
export default {
  data() {
    return {};
  },
};
</script>
 
<style lang = "less" scoped>
@import "../assets/base.less";

nav {
  background: #fff;
  .nav_in {
    align-items: center;
    height: 100px;
    ul {
      width: 500px;
      li {
        font-size: 16px;
        font-family: SourceHanSansSC;
        color: #242B39;
        line-height: 23px;
        cursor: pointer;
        &.active {
          color: @blue;
          font-weight: bold;
        }
      }
    }
    .search {
      width: 264px;
      height: 40px;
      border-radius: 20px;
      overflow: hidden;
      input {
        width: 214px;
        height: 40px;
        border: 1px solid #dedede;
        border-radius: 20px 0px 0px 20px;
        box-sizing: border-box;
        font-size: 14px;
        text-indent: 1em;
        outline: none;
      }
      .btn {
        width: 50px;
        height: 40px;
        background: #0a328e;
        border-radius: 0px 20px 20px 0px;
        display: flex;
        justify-content: center;
        align-items: center;
        cursor: pointer;
        overflow: hidden;
        transition: 1s;
        &:hover img {
          transform: scale(1.10);
          transition: 1s;
        }
      }
    }
  }
}
</style>